<template>
  <h1>欢迎用户注册</h1>
  <el-form style="
           height:100vh;
           background-image:linear-gradient(135deg,#1352f2,#3c82f5);
           overflow: hidden;">
    <el-form-item label="用户名" style="font-size: 30px;color: #fff;font-weight: bold;width: 500px;margin:0 auto">
      <el-input  placeholder="请输入用户名" v-model="user.username"></el-input>
    </el-form-item>
    <el-form-item label="密码" style="font-size: 30px;color: #fff;font-weight: bold; width: 500px;margin:0 auto">
      <el-input type="password" placeholder="请输入密码" v-model="user.password" ></el-input>
        <el-button type="primary" @click="reg">注册</el-button>
    </el-form-item>
  </el-form>
  <el-button>
  </el-button>

</template>

<script setup>
import router from "@/router";
import axios from "axios";
import {ref} from "vue";

const user = ref({
  username:'',
  psssword:'',
})
const reg = ()=>{
  console.log(user.value);
  // router.push('/regedit');
  axios.post(BASE_URL+'/v1/user/regedit',user.value).then((response)=>{
    if (response.data.code==2000){
      router.push('/login')
    }
  });


}

</script>


<style scoped>

</style>